package qhLoading.loaders 
{
	import flash.display.Sprite;
	import flash.system.ApplicationDomain;
	/**
	 * ...
	 * @author gcxk721
	 */
	public class SwfLoader extends BaseLoader 
	{
		
		private var _appDomain : ApplicationDomain;

        public function SwfLoader()
        {
            return;
        }

        override public function getClass() : Class
        {
            return SwfLoader;
        }

        public function getAssetClass(clsName : String) : Class
        {
            if (_appDomain == null)
            {
                throw new Error("not initialized");
            }
            if (_appDomain.hasDefinition(clsName))
            {
                return _appDomain.getDefinition(clsName) as Class;
            }
            return null;
        }

        override protected function onContentReady(value : Object) : Boolean
        {
            if (loaderInfo)
            {
                if (resourceInfo)
                {
                    resourceInfo.data = loaderInfo;
                }
                _appDomain = loaderInfo.applicationDomain;
            }
            return value as Sprite != null;
        }

	}

}